home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / popo.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.6 KB  |  90 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8.  
  9. call RxMUIOpt("debugmode showerr")
  10. call CreateApp
  11. call HandleApp
  12. /* never reached */
  13. /***********************************************************************/
  14. HandleApp: procedure
  15.  
  16.     ctrl_c=2**12
  17.     do forever
  18.         call NewHandle("app","h",ctrl_c)
  19.         if and(h.signals,ctrl_c)>0 then exit
  20.         select
  21.             when h.event="QUIT" then exit
  22.             otherwise interpret h.event
  23.         end
  24.     end
  25.     /* never reached */
  26. /***********************************************************************/
  27. err: procedure expose sigl rxmuierror
  28. parse arg res
  29. say sigl "["res"]"
  30.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  31.     exit
  32. /***********************************************************************/
  33. CreateApp: procedure
  34.  
  35.     listview.frame="inputlist"
  36.     listview.list="l"
  37.     res=NewObj("listview","listview")
  38.     if res~=0 then call err(res)
  39.  
  40.     po.object="pg"
  41.     pg.class="group"
  42.     pg.0="listview"
  43.     pg.1=button("closepo","Close")
  44.     po.string=string("S")
  45.     po.button=makeobj("","Imagebutton","popup")
  46.     po.toggle=1
  47.     po.openfun="call domethod('l','clear');call set('l','quiet',1);pl=show('p',,'/');do while pl~='';parse var pl p '/' pl;call domethod('l','insert',p,'sorted');end;call set('l','quiet',0);return 1"
  48.     po.closefun="call DoMethod('l','GetEntry','active','A');call set('s','contents',a)"
  49.  
  50.     res = NewObj("popobject","po")
  51.     if res~=0 then call err(res)
  52.  
  53.     app.Title="PopObject"
  54.     app.Version="$VER: PopObject 1.0 (22.11.99)"
  55.     app.Copyright="©1999, alfie"
  56.     app.Author="alfie"
  57.     app.Description="PopObject show"
  58.     app.Base="POPO"
  59.     app.SubWindow="win"
  60.      win.Title="PopObject"
  61.      win.ID="MAIN"
  62.      win.Contents="mgroup"
  63.       mgroup.0="po"
  64.  
  65.     res=NewObj("application","app")
  66.     if res~=0 then call err(res)
  67.  
  68.     call notify("win","CloseRequest",1,"app","ReturnID","quit")
  69.     call notify("listview","DoubleClick","EveryTime","po","close",1)
  70.     call notify("closepo","pressed",0,"po","close")
  71.  
  72.     call set("win","open",1)
  73.     call getattr("win","open","o")
  74.     if o=0 then do
  75.         say "can't open window"
  76.         exit
  77.     end
  78.  
  79.     return
  80. /***********************************************************************/
  81. halt:
  82. break_c:
  83.     exit
  84. /**************************************************************************/
  85. popofun: procedure
  86.     call DoMethod('l','GetEntry','active','A')
  87.     call set('s','contents',a)
  88.     return
  89. /**************************************************************************/
  90.